import myRequest from "./config/request";

const URL = "/notice";

export function getNoitceListAPi(currentPage, pageSize) {
  return myRequest.post({
    url: URL + "/getNoticeList",
    data: {
      currentPage,
      pageSize,
    },
  });
}

export function getNoticeListByNoticeTitleApi(
  noticeTitle,
  currentPage,
  pageSize
) {
  console.log(noticeTitle, currentPage, pageSize);
  return myRequest.post({
    url: URL + "/getNoticeListByNoticeTitle",
    data: {
      noticeTitle,
      currentPage,
      pageSize,
    },
  });
}

export function createNoticeApi(noticeObj) {
  return myRequest.post({
    url: URL + "/createNotice",
    data: noticeObj,
  });
}

export function updateNoticeApi(noticeObj) {
  return myRequest.post({
    url: URL + "/updateNotice",
    data: noticeObj,
  });
}

export function deleteNoticeApi(id) {
  return myRequest.get({
    url: URL + "/deleteNotice?id=" + id,
  });
}
